package com.ruangong.GitClient.app.Password;

import android.content.Context;
import android.view.LayoutInflater;
import android.view.View;
import android.view.ViewGroup;
import android.widget.ArrayAdapter;
import android.widget.TextView;
import java.util.ArrayList;

import com.ruangong.GitClient.R;
import com.ruangong.GitClient.app.Password.Password;

public class PasswordAdapter extends ArrayAdapter<Password> {
    private ArrayList<Password> passwordList;

    public PasswordAdapter(Context context, ArrayList<Password> passwords) {
        super(context, 0, passwords);
        passwordList = passwords;
    }

    @Override
    public View getView(int position, View convertView, ViewGroup parent) {
        Password password = getItem(position);
        if (convertView == null) {
            convertView = LayoutInflater.from(getContext()).inflate(R.layout.name_password, parent, false);
        }

        // 找到布局文件中的文本控件
        TextView websiteTextView = convertView.findViewById(R.id.websiteTextView);

        // 设置文本控件显示的内容
        websiteTextView.setText(password.getWebsite());

        return convertView;
    }


}


